/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2024-11-23
 * Time: 12:11
 */

class Solution5 {
    public int[] singleNumber(int[] nums) {
        int ret = 0;
        for(int x : nums){
            ret ^= x;
        }

        int sign = ret & (-ret);
        int firNum = 0;
        int secNum = 0;
        for(int x : nums){
            if((sign & x) == 0){
                firNum ^= x;
            }else{
                secNum ^= x;
            }
        }
        int[] result = new int[2];
        result[0] = firNum;
        result[1] = secNum;
        return result;

    }
}
public class Test5 {
}
